[{"data":1,"prerenderedAt":1117},["ShallowReactive",2],{"navigation":3,"\u002Fauthorization\u002Fdecision-cache":307,"\u002Fauthorization\u002Fdecision-cache-surround":1112},{"3.x":4,"2.x":203},[5,32,61,99,121,147,165],{"title":6,"icon":7,"path":8,"stem":9,"children":10,"page":31},"Getting Started","i-heroicons-star","\u002Fgetting-started","1.getting-started",[11,15,19,23,27],{"title":12,"path":13,"stem":14},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction",{"title":16,"path":17,"stem":18},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation",{"title":20,"path":21,"stem":22},"Quick start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start",{"title":24,"path":25,"stem":26},"Configuration","\u002Fgetting-started\u002Fconfiguration","1.getting-started\u002F4.configuration",{"title":28,"path":29,"stem":30},"Upgrade guide","\u002Fgetting-started\u002Fupgrade-guide","1.getting-started\u002F5.upgrade-guide",false,{"title":33,"icon":34,"path":35,"stem":36,"children":37,"page":31},"Resources","i-heroicons-document-text","\u002Fresources","2.resources",[38,41,45,49,53,57],{"title":33,"path":39,"stem":40},"\u002Fresources\u002Fresources","2.resources\u002F1.resources",{"title":42,"path":43,"stem":44},"Fields","\u002Fresources\u002Ffields","2.resources\u002F2.fields",{"title":46,"path":47,"stem":48},"Relationships","\u002Fresources\u002Frelations","2.resources\u002F3.relations",{"title":50,"path":51,"stem":52},"Validation","\u002Fresources\u002Fvalidation","2.resources\u002F4.validation",{"title":54,"path":55,"stem":56},"Perimeter","\u002Fresources\u002Fperimeter","2.resources\u002F5.perimeter",{"title":58,"path":59,"stem":60},"Limits","\u002Fresources\u002Flimits","2.resources\u002F6.limits",{"title":62,"icon":63,"path":64,"stem":65,"children":66,"page":31},"Search","i-heroicons-magnifying-glass","\u002Fsearch","3.search",[67,71,75,79,83,87,91,95],{"title":68,"path":69,"stem":70},"Search overview","\u002Fsearch\u002Foverview","3.search\u002F1.overview",{"title":72,"path":73,"stem":74},"Search filters","\u002Fsearch\u002Ffilters","3.search\u002F2.filters",{"title":76,"path":77,"stem":78},"Sorts and selects","\u002Fsearch\u002Fsorts-and-selects","3.search\u002F3.sorts-and-selects",{"title":80,"path":81,"stem":82},"Includes and aggregates","\u002Fsearch\u002Fincludes-and-aggregates","3.search\u002F4.includes-and-aggregates",{"title":84,"path":85,"stem":86},"Scopes and instructions","\u002Fsearch\u002Fscopes-and-instructions","3.search\u002F5.scopes-and-instructions",{"title":88,"path":89,"stem":90},"Text search","\u002Fsearch\u002Ftext-search","3.search\u002F6.text-search",{"title":92,"path":93,"stem":94},"Search engines","\u002Fsearch\u002Fsearch-engines","3.search\u002F7.search-engines",{"title":96,"path":97,"stem":98},"Searching outside HTTP","\u002Fsearch\u002Foutside-http","3.search\u002F8.outside-http",{"title":100,"icon":101,"path":102,"stem":103,"children":104,"page":31},"Writing","i-heroicons-pencil-square","\u002Fwriting","4.writing",[105,109,113,117],{"title":106,"path":107,"stem":108},"Mutate","\u002Fwriting\u002Fmutate","4.writing\u002F1.mutate",{"title":110,"path":111,"stem":112},"Writing relations","\u002Fwriting\u002Frelations","4.writing\u002F2.relations",{"title":114,"path":115,"stem":116},"Versioned rows","\u002Fwriting\u002Fversioned-rows","4.writing\u002F3.versioned-rows",{"title":118,"path":119,"stem":120},"Deleting and restoring","\u002Fwriting\u002Fdeleting","4.writing\u002F4.deleting",{"title":122,"icon":123,"path":124,"stem":125,"children":126,"page":31},"Actions and Metrics","i-heroicons-bolt","\u002Factions-and-metrics","5.actions-and-metrics",[127,131,135,139,143],{"title":128,"path":129,"stem":130},"Actions","\u002Factions-and-metrics\u002Factions","5.actions-and-metrics\u002F1.actions",{"title":132,"path":133,"stem":134},"Queued Actions","\u002Factions-and-metrics\u002Fqueued-actions","5.actions-and-metrics\u002F2.queued-actions",{"title":136,"path":137,"stem":138},"Confirmation","\u002Factions-and-metrics\u002Fconfirmation","5.actions-and-metrics\u002F3.confirmation",{"title":140,"path":141,"stem":142},"Metrics","\u002Factions-and-metrics\u002Fmetrics","5.actions-and-metrics\u002F4.metrics",{"title":144,"path":145,"stem":146},"Exports","\u002Factions-and-metrics\u002Fexports","5.actions-and-metrics\u002F5.exports",{"title":148,"icon":149,"path":150,"stem":151,"children":152,"page":31},"Authorization","i-heroicons-lock-closed","\u002Fauthorization","6.authorization",[153,157,161],{"title":154,"path":155,"stem":156},"Policies","\u002Fauthorization\u002Fpolicies","6.authorization\u002F1.policies",{"title":158,"path":159,"stem":160},"Gates","\u002Fauthorization\u002Fgates","6.authorization\u002F2.gates",{"title":162,"path":163,"stem":164},"Decision Cache","\u002Fauthorization\u002Fdecision-cache","6.authorization\u002F3.decision-cache",{"title":166,"icon":167,"path":168,"stem":169,"children":170,"page":31},"Digging Deeper","i-heroicons-list-bullet","\u002Fdigging-deeper","7.digging-deeper",[171,175,179,183,187,191,195,199],{"title":172,"path":173,"stem":174},"Details","\u002Fdigging-deeper\u002Fdetails","7.digging-deeper\u002F1.details",{"title":176,"path":177,"stem":178},"Events and Hooks","\u002Fdigging-deeper\u002Fevents-and-hooks","7.digging-deeper\u002F2.events-and-hooks",{"title":180,"path":181,"stem":182},"Custom Responses","\u002Fdigging-deeper\u002Fresponses","7.digging-deeper\u002F3.responses",{"title":184,"path":185,"stem":186},"OpenAPI Documentation","\u002Fdigging-deeper\u002Fopenapi","7.digging-deeper\u002F4.openapi",{"title":188,"path":189,"stem":190},"Precognition","\u002Fdigging-deeper\u002Fprecognition","7.digging-deeper\u002F5.precognition",{"title":192,"path":193,"stem":194},"Artisan Commands","\u002Fdigging-deeper\u002Fartisan","7.digging-deeper\u002F6.artisan",{"title":196,"path":197,"stem":198},"Laravel Boost Skill","\u002Fdigging-deeper\u002Fai-skill","7.digging-deeper\u002F7.ai-skill",{"title":200,"path":201,"stem":202},"Translations","\u002Fdigging-deeper\u002Ftranslations","7.digging-deeper\u002F8.translations",[204,215,237,260,297],{"title":6,"icon":7,"path":205,"stem":206,"children":207,"page":31},"\u002F2.x\u002Fgetting-started","2.x\u002F1.getting-started",[208,211],{"title":16,"path":209,"stem":210},"\u002F2.x\u002Fgetting-started\u002Finstallation","2.x\u002F1.getting-started\u002F1.installation",{"title":212,"path":213,"stem":214},"Upgrade Guide","\u002F2.x\u002Fgetting-started\u002Fupgrade-guide","2.x\u002F1.getting-started\u002F2.upgrade-guide",{"title":216,"icon":217,"path":218,"stem":219,"children":220,"page":31},"Endpoints","i-heroicons-arrow-uturn-left","\u002F2.x\u002Fendpoints","2.x\u002F2.endpoints",[221,224,227,230,233],{"title":172,"path":222,"stem":223},"\u002F2.x\u002Fendpoints\u002Fdetails","2.x\u002F2.endpoints\u002F1.details",{"title":62,"path":225,"stem":226},"\u002F2.x\u002Fendpoints\u002Fsearch","2.x\u002F2.endpoints\u002F2.search",{"title":106,"path":228,"stem":229},"\u002F2.x\u002Fendpoints\u002Fmutate","2.x\u002F2.endpoints\u002F3.mutate",{"title":128,"path":231,"stem":232},"\u002F2.x\u002Fendpoints\u002Factions","2.x\u002F2.endpoints\u002F4.actions",{"title":234,"path":235,"stem":236},"Delete","\u002F2.x\u002Fendpoints\u002Fdelete","2.x\u002F2.endpoints\u002F5.delete",{"title":33,"icon":34,"path":238,"stem":239,"children":240,"page":31},"\u002F2.x\u002Fresources","2.x\u002F3.resources",[241,245,249,252,256],{"title":242,"path":243,"stem":244},"Basics","\u002F2.x\u002Fresources\u002Fbasics","2.x\u002F3.resources\u002F1.basics",{"title":246,"path":247,"stem":248},"Exposed Data","\u002F2.x\u002Fresources\u002Fexposed-data","2.x\u002F3.resources\u002F2.exposed-data",{"title":46,"path":250,"stem":251},"\u002F2.x\u002Fresources\u002Frelationships","2.x\u002F3.resources\u002F3.relationships",{"title":253,"path":254,"stem":255},"Validations","\u002F2.x\u002Fresources\u002Fvalidations","2.x\u002F3.resources\u002F4.validations",{"title":257,"path":258,"stem":259},"Interactions","\u002F2.x\u002Fresources\u002Finteractions","2.x\u002F3.resources\u002F5.interactions",{"title":166,"icon":167,"path":261,"stem":262,"children":263,"page":31},"\u002F2.x\u002Fdigging-deeper","2.x\u002F4.digging-deeper",[264,267,271,274,278,282,286,290,294],{"title":128,"path":265,"stem":266},"\u002F2.x\u002Fdigging-deeper\u002Factions","2.x\u002F4.digging-deeper\u002F1.actions",{"title":268,"path":269,"stem":270},"Hooks","\u002F2.x\u002Fdigging-deeper\u002Fhooks","2.x\u002F4.digging-deeper\u002F2.hooks",{"title":158,"path":272,"stem":273},"\u002F2.x\u002Fdigging-deeper\u002Fgates","2.x\u002F4.digging-deeper\u002F3.gates",{"title":275,"path":276,"stem":277},"Authorizations","\u002F2.x\u002Fdigging-deeper\u002Fauthorizations","2.x\u002F4.digging-deeper\u002F4.authorizations",{"title":279,"path":280,"stem":281},"Full Text Search","\u002F2.x\u002Fdigging-deeper\u002Ffull-text-search","2.x\u002F4.digging-deeper\u002F5.full-text-search",{"title":283,"path":284,"stem":285},"Instructions","\u002F2.x\u002Fdigging-deeper\u002Finstructions","2.x\u002F4.digging-deeper\u002F6.instructions",{"title":287,"path":288,"stem":289},"Responses","\u002F2.x\u002Fdigging-deeper\u002Fresponses","2.x\u002F4.digging-deeper\u002F7.responses",{"title":291,"path":292,"stem":293},"Documentation","\u002F2.x\u002Fdigging-deeper\u002Fdocumentation","2.x\u002F4.digging-deeper\u002F8.documentation",{"title":188,"path":295,"stem":296},"\u002F2.x\u002Fdigging-deeper\u002Fprecognition","2.x\u002F4.digging-deeper\u002F9.precognition",{"title":298,"icon":299,"path":300,"stem":301,"children":302,"page":31},"Integrations","i-lucide-puzzle","\u002F2.x\u002Fintegrations","2.x\u002F5.integrations",[303],{"title":304,"path":305,"stem":306},"Flutter","\u002F2.x\u002Fintegrations\u002Fflutter","2.x\u002F5.integrations\u002F1.flutter",{"id":308,"title":162,"body":309,"description":1105,"extension":1106,"links":1107,"meta":1108,"navigation":751,"path":163,"seo":1109,"sitemap":1110,"stem":164,"__hash__":1111},"docs3x\u002F6.authorization\u002F3.decision-cache.md",{"type":310,"value":311,"toc":1094},"minimark",[312,316,321,329,418,467,484,488,527,531,548,561,566,571,633,643,647,650,701,712,716,784,805,808,811,911,951,955,962,1090],[313,314,315],"p",{},"Within one request, each distinct check runs the policy once. Between requests, the package keeps only the decisions that a resource declares. A resource that declares nothing keeps nothing.",[317,318,320],"h2",{"id":319},"declaring-the-cached-abilities","Declaring the cached abilities",[313,322,323,324,328],{},"List in ",[325,326,327],"code",{},"authorizationCache()"," the abilities to keep, with the number of seconds to keep each one:",[330,331,336],"pre",{"className":332,"code":333,"language":334,"meta":335,"style":335},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","public function authorizationCache(): array\n{\n    return ['viewAny' => 300, 'view' => 60];\n}\n","php","",[325,337,338,362,368,412],{"__ignoreMap":335},[339,340,343,347,350,354,358],"span",{"class":341,"line":342},"line",1,[339,344,346],{"class":345},"spNyl","public",[339,348,349],{"class":345}," function",[339,351,353],{"class":352},"s2Zo4"," authorizationCache",[339,355,357],{"class":356},"sMK4o","():",[339,359,361],{"class":360},"sbssI"," array\n",[339,363,365],{"class":341,"line":364},2,[339,366,367],{"class":356},"{\n",[339,369,371,375,378,381,385,387,390,393,396,399,402,404,406,409],{"class":341,"line":370},3,[339,372,374],{"class":373},"s7zQu","    return",[339,376,377],{"class":356}," [",[339,379,380],{"class":356},"'",[339,382,384],{"class":383},"sfazB","viewAny",[339,386,380],{"class":356},[339,388,389],{"class":356}," =>",[339,391,392],{"class":360}," 300",[339,394,395],{"class":356},",",[339,397,398],{"class":356}," '",[339,400,401],{"class":383},"view",[339,403,380],{"class":356},[339,405,389],{"class":356},[339,407,408],{"class":360}," 60",[339,410,411],{"class":356},"];\n",[339,413,415],{"class":341,"line":414},4,[339,416,417],{"class":356},"}\n",[419,420,421,425,432,442,464],"ul",{},[422,423,424],"li",{},"The other abilities run the policy in each request.",[422,426,427,428,431],{},"A duration that is not an integer of 1 or more throws ",[325,429,430],{},"Lomkit\\Rest\\Exceptions\\InvalidResourceException",".",[422,433,434,435,437,438,441],{},"The resource of the check declares the ability: the resource of the endpoint or of the reached relation for ",[325,436,384],{}," and ",[325,439,440],{},"create",", the resource of the row for its gates and its row checks, and the parent resource for the link abilities of a relation.",[422,443,444,445,449,450,453,454,453,457,437,460,463],{},"A declared ability is read from the cache wherever it is checked: the ",[446,447,448],"a",{"href":159},"gates"," of a response, the checks before validation, the row checks of ",[325,451,452],{},"mutate",", ",[325,455,456],{},"destroy",[325,458,459],{},"restore",[325,461,462],{},"forceDestroy",", and the row checks of actions.",[422,465,466],{},"Denials are kept like the other decisions, with their message and status.",[468,469,470],"warning",{},[313,471,472,473,476,477,479,480,483],{},"A cached ",[325,474,475],{},"delete"," on a row lets ",[325,478,456],{}," delete that row without calling the policy while the row keeps its ",[325,481,482],{},"updated_at",". Cache the write abilities only when their policy reads nothing that changes outside the row.",[317,485,487],{"id":486},"what-is-never-kept","What is never kept",[419,489,490,509,515,521,524],{},[422,491,492,493,495,496,498,499,502,503,505,506,508],{},"The check of ",[325,494,440],{}," on each row that ",[325,497,452],{}," creates, and the ",[325,500,501],{},"update"," checks of ",[325,504,452],{},", which carry the changes of their entry. The ",[325,507,440],{}," check on the model class can be kept.",[422,510,511,512,514],{},"A decision on a row without ",[325,513,482],{},". Add timestamps to a model to keep the decisions on its rows.",[422,516,517,518,520],{},"A decision on a row whose ",[325,519,482],{}," is not before the second in which the request started.",[422,522,523],{},"A check on a row that the request wrote.",[422,525,526],{},"A check on a model that is not saved yet.",[317,528,530],{"id":529},"the-key","The key",[313,532,533,534,536,537,540,541,437,544,547],{},"The key holds the guard, the user class and key, the resource class, the ability, the class, key and ",[325,535,482],{}," of each model, the values of ",[325,538,539],{},"authorizationCacheContext()",", and the stamps that ",[325,542,543],{},"Rest::forgetAuthorizationsFor()",[325,545,546],{},"Rest::forgetAuthorizations()"," renew.",[313,549,550,551,553,554,556,557,560],{},"A decision on a row follows the row's ",[325,552,482],{},", so a change made through Eloquent is checked again in the next request. A change made without Eloquent that leaves ",[325,555,482],{}," alone, such as ",[325,558,559],{},"DB::table()->update()",", shows once the entry expires or the user is forgotten.",[562,563,565],"h3",{"id":564},"adding-values-to-the-key","Adding values to the key",[313,567,568,570],{},[325,569,539],{}," adds values of your own to the key of every decision that the resource keeps, for example the team of the user:",[330,572,574],{"className":332,"code":573,"language":334,"meta":335,"style":335},"public function authorizationCacheContext(): array\n{\n    return ['team' => $this->request()->user()?->current_team_id];\n}\n",[325,575,576,589,593,629],{"__ignoreMap":335},[339,577,578,580,582,585,587],{"class":341,"line":342},[339,579,346],{"class":345},[339,581,349],{"class":345},[339,583,584],{"class":352}," authorizationCacheContext",[339,586,357],{"class":356},[339,588,361],{"class":360},[339,590,591],{"class":341,"line":364},[339,592,367],{"class":356},[339,594,595,597,599,601,604,606,608,611,614,617,620,623,627],{"class":341,"line":370},[339,596,374],{"class":373},[339,598,377],{"class":356},[339,600,380],{"class":356},[339,602,603],{"class":383},"team",[339,605,380],{"class":356},[339,607,389],{"class":356},[339,609,610],{"class":356}," $this->",[339,612,613],{"class":352},"request",[339,615,616],{"class":356},"()->",[339,618,619],{"class":352},"user",[339,621,622],{"class":356},"()?->",[339,624,626],{"class":625},"sTEyZ","current_team_id",[339,628,411],{"class":356},[339,630,631],{"class":341,"line":414},[339,632,417],{"class":356},[313,634,635,636,639,640,431],{},"A value is an integer, a string, a boolean or ",[325,637,638],{},"null",". Another value throws ",[325,641,642],{},"InvalidResourceException",[562,644,646],{"id":645},"tenants","Tenants",[313,648,649],{},"The key holds the user class and key, not the tenant. With several tenants whose users share identifiers, add the tenant in the base resource of your application:",[330,651,653],{"className":332,"code":652,"language":334,"meta":335,"style":335},"public function authorizationCacheContext(): array\n{\n    return ['tenant' => tenant()?->getTenantKey()];\n}\n",[325,654,655,667,671,697],{"__ignoreMap":335},[339,656,657,659,661,663,665],{"class":341,"line":342},[339,658,346],{"class":345},[339,660,349],{"class":345},[339,662,584],{"class":352},[339,664,357],{"class":356},[339,666,361],{"class":360},[339,668,669],{"class":341,"line":364},[339,670,367],{"class":356},[339,672,673,675,677,679,682,684,686,689,691,694],{"class":341,"line":370},[339,674,374],{"class":373},[339,676,377],{"class":356},[339,678,380],{"class":356},[339,680,681],{"class":383},"tenant",[339,683,380],{"class":356},[339,685,389],{"class":356},[339,687,688],{"class":352}," tenant",[339,690,622],{"class":356},[339,692,693],{"class":352},"getTenantKey",[339,695,696],{"class":356},"()];\n",[339,698,699],{"class":341,"line":414},[339,700,417],{"class":356},[313,702,703,704,707,708,431],{},"Or name in ",[325,705,706],{},"authorizations.cache.store"," a store that is already per tenant. The context also keys the ",[446,709,711],{"href":710},"\u002Factions-and-metrics\u002Fmetrics#caching-a-result","metric results",[317,713,715],{"id":714},"forgetting-decisions","Forgetting decisions",[330,717,719],{"className":332,"code":718,"language":334,"meta":335,"style":335},"use Lomkit\\Rest\\Facades\\Rest;\n\nRest::forgetAuthorizationsFor($user);\nRest::forgetAuthorizations();\n",[325,720,721,747,753,772],{"__ignoreMap":335},[339,722,723,726,729,732,735,737,740,742,744],{"class":341,"line":342},[339,724,725],{"class":360},"use",[339,727,728],{"class":625}," Lomkit",[339,730,731],{"class":356},"\\",[339,733,734],{"class":625},"Rest",[339,736,731],{"class":356},[339,738,739],{"class":625},"Facades",[339,741,731],{"class":356},[339,743,734],{"class":625},[339,745,746],{"class":356},";\n",[339,748,749],{"class":341,"line":364},[339,750,752],{"emptyLinePlaceholder":751},true,"\n",[339,754,755,758,761,764,767,769],{"class":341,"line":370},[339,756,734],{"class":757},"sBMFI",[339,759,760],{"class":356},"::",[339,762,763],{"class":352},"forgetAuthorizationsFor",[339,765,766],{"class":356},"($",[339,768,619],{"class":625},[339,770,771],{"class":356},");\n",[339,773,774,776,778,781],{"class":341,"line":414},[339,775,734],{"class":757},[339,777,760],{"class":356},[339,779,780],{"class":352},"forgetAuthorizations",[339,782,783],{"class":356},"();\n",[419,785,786,796,802],{},[422,787,788,791,792,795],{},[325,789,790],{},"forgetAuthorizationsFor($user)"," drops the kept decisions and metric results of a user, on every guard. Call it where your application changes what a policy or a ",[325,793,794],{},"Gate::before()"," callback reads about the user, such as a role or a team.",[422,797,798,801],{},[325,799,800],{},"forgetAuthorizations()"," drops the kept decisions and metric results of every user and of guests, for example after a deploy that changes a policy.",[422,803,804],{},"Both work on every cache store, and write even when the cache is off.",[313,806,807],{},"Otherwise a kept decision stays for the seconds of its ability: a change to a policy shows once the entry expires.",[317,809,24],{"id":810},"configuration",[330,812,814],{"className":332,"code":813,"language":334,"meta":335,"style":335},"'authorizations' => [\n    'cache' => [\n        'enabled' => env('REST_AUTHORIZATIONS_CACHE_ENABLED', true),\n        'store' => env('REST_AUTHORIZATIONS_CACHE_STORE'),\n    ],\n],\n",[325,815,816,830,844,874,899,905],{"__ignoreMap":335},[339,817,818,820,823,825,827],{"class":341,"line":342},[339,819,380],{"class":356},[339,821,822],{"class":383},"authorizations",[339,824,380],{"class":356},[339,826,389],{"class":356},[339,828,829],{"class":356}," [\n",[339,831,832,835,838,840,842],{"class":341,"line":364},[339,833,834],{"class":356},"    '",[339,836,837],{"class":383},"cache",[339,839,380],{"class":356},[339,841,389],{"class":356},[339,843,829],{"class":356},[339,845,846,849,852,854,856,859,862,864,867,869,871],{"class":341,"line":370},[339,847,848],{"class":356},"        '",[339,850,851],{"class":383},"enabled",[339,853,380],{"class":356},[339,855,389],{"class":356},[339,857,858],{"class":352}," env",[339,860,861],{"class":356},"(",[339,863,380],{"class":356},[339,865,866],{"class":383},"REST_AUTHORIZATIONS_CACHE_ENABLED",[339,868,380],{"class":356},[339,870,395],{"class":356},[339,872,873],{"class":356}," true),\n",[339,875,876,878,881,883,885,887,889,891,894,896],{"class":341,"line":414},[339,877,848],{"class":356},[339,879,880],{"class":383},"store",[339,882,380],{"class":356},[339,884,389],{"class":356},[339,886,858],{"class":352},[339,888,861],{"class":356},[339,890,380],{"class":356},[339,892,893],{"class":383},"REST_AUTHORIZATIONS_CACHE_STORE",[339,895,380],{"class":356},[339,897,898],{"class":356},"),\n",[339,900,902],{"class":341,"line":901},5,[339,903,904],{"class":356},"    ],\n",[339,906,908],{"class":341,"line":907},6,[339,909,910],{"class":356},"],\n",[419,912,913,926,938,948],{},[422,914,915,917,918,921,922,925],{},[325,916,851],{}," set to ",[325,919,920],{},"false"," turns the cache off for every resource. Set ",[325,923,924],{},"REST_AUTHORIZATIONS_CACHE_ENABLED=false"," while you debug policies.",[422,927,928,930,931,933,934,937],{},[325,929,880],{}," names the cache store, the default store when ",[325,932,638],{},". A store that is not defined throws ",[325,935,936],{},"Cache store [name] is not defined."," on the first check of a declared ability.",[422,939,940,941,437,944,947],{},"A decision is stored as an array of scalars, so any store works, ",[325,942,943],{},"file",[325,945,946],{},"database"," included.",[422,949,950],{},"When no resource declares an ability, the package calls no cache store.",[317,952,954],{"id":953},"grouping-your-own-checks","Grouping your own checks",[313,956,957,958,961],{},"The package reads the kept decisions of a group of checks in one call, and writes the decisions it evaluated in one call per duration. ",[325,959,960],{},"authorizer()->batch()"," groups checks of your own the same way:",[330,963,965],{"className":332,"code":964,"language":334,"meta":335,"style":335},"use Lomkit\\Rest\\Authorization\\Check;\n\n$this->request()->context()->authorizer()->batch(\n    [Check::onClass($resource, 'viewAny')],\n    fn () => $resource->authorizedTo('viewAny', Post::class),\n);\n",[325,966,967,988,992,1017,1045,1086],{"__ignoreMap":335},[339,968,969,971,973,975,977,979,981,983,986],{"class":341,"line":342},[339,970,725],{"class":360},[339,972,728],{"class":625},[339,974,731],{"class":356},[339,976,734],{"class":625},[339,978,731],{"class":356},[339,980,148],{"class":625},[339,982,731],{"class":356},[339,984,985],{"class":625},"Check",[339,987,746],{"class":356},[339,989,990],{"class":341,"line":364},[339,991,752],{"emptyLinePlaceholder":751},[339,993,994,997,999,1001,1004,1006,1009,1011,1014],{"class":341,"line":370},[339,995,996],{"class":356},"$this->",[339,998,613],{"class":352},[339,1000,616],{"class":356},[339,1002,1003],{"class":352},"context",[339,1005,616],{"class":356},[339,1007,1008],{"class":352},"authorizer",[339,1010,616],{"class":356},[339,1012,1013],{"class":352},"batch",[339,1015,1016],{"class":356},"(\n",[339,1018,1019,1022,1024,1026,1029,1031,1034,1036,1038,1040,1042],{"class":341,"line":414},[339,1020,1021],{"class":356},"    [",[339,1023,985],{"class":757},[339,1025,760],{"class":356},[339,1027,1028],{"class":352},"onClass",[339,1030,766],{"class":356},[339,1032,1033],{"class":625},"resource",[339,1035,395],{"class":356},[339,1037,398],{"class":356},[339,1039,384],{"class":383},[339,1041,380],{"class":356},[339,1043,1044],{"class":356},")],\n",[339,1046,1047,1050,1053,1055,1058,1060,1063,1066,1068,1070,1072,1074,1076,1079,1081,1084],{"class":341,"line":901},[339,1048,1049],{"class":345},"    fn",[339,1051,1052],{"class":356}," ()",[339,1054,389],{"class":356},[339,1056,1057],{"class":356}," $",[339,1059,1033],{"class":625},[339,1061,1062],{"class":356},"->",[339,1064,1065],{"class":352},"authorizedTo",[339,1067,861],{"class":356},[339,1069,380],{"class":356},[339,1071,384],{"class":383},[339,1073,380],{"class":356},[339,1075,395],{"class":356},[339,1077,1078],{"class":757}," Post",[339,1080,760],{"class":356},[339,1082,1083],{"class":360},"class",[339,1085,898],{"class":356},[339,1087,1088],{"class":341,"line":907},[339,1089,771],{"class":356},[1091,1092,1093],"style",{},"html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":335,"searchDepth":342,"depth":364,"links":1095},[1096,1097,1098,1102,1103,1104],{"id":319,"depth":364,"text":320},{"id":486,"depth":364,"text":487},{"id":529,"depth":364,"text":530,"children":1099},[1100,1101],{"id":564,"depth":370,"text":565},{"id":645,"depth":370,"text":646},{"id":714,"depth":364,"text":715},{"id":810,"depth":364,"text":24},{"id":953,"depth":364,"text":954},"Keep the decisions of chosen policy abilities between requests, key them per user and tenant, and forget them when rights change.","md",null,{},{"title":162,"description":1105},{"loc":163},"IZgxX4uI9M4Rdj7q2a-zHFufYfrGGYaSOsJ-f9Y_qvY",[1113,1115],{"title":158,"path":159,"stem":160,"description":1114,"children":-1},"Tell clients what the user may do with each row of a search, with the answers and messages of your policies, and your own gates.",{"title":172,"path":173,"stem":174,"description":1116,"children":-1},"Describe a resource to clients with a thin base, then ask for fields, relations, actions, metrics and authorizations with the with parameter.",1794181355224]