[{"data":1,"prerenderedAt":1175},["ShallowReactive",2],{"navigation":3,"\u002Fessentials\u002Fboundaries":173,"\u002Fessentials\u002Fboundaries-surround":1170},[4,27,69,103,113,135],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":26},"Getting Started","i-heroicons-star","\u002Fgetting-started","1.getting-started",[10,14,18,22],{"title":11,"path":12,"stem":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction",{"title":15,"path":16,"stem":17},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation",{"title":19,"path":20,"stem":21},"Quick start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start",{"title":23,"path":24,"stem":25},"Upgrade guide","\u002Fgetting-started\u002Fupgrade-guide","1.getting-started\u002F5.upgrade-guide",false,{"title":28,"icon":29,"path":30,"stem":31,"children":32,"page":26},"Essentials","i-heroicons-shield-check","\u002Fessentials","2.essentials",[33,37,41,45,49,53,57,61,65],{"title":34,"path":35,"stem":36},"Controls","\u002Fessentials\u002Fcontrols","2.essentials\u002F1.controls",{"title":38,"path":39,"stem":40},"Perimeters","\u002Fessentials\u002Fperimeters","2.essentials\u002F2.perimeters",{"title":42,"path":43,"stem":44},"Perimeter classes","\u002Fessentials\u002Fperimeter-classes","2.essentials\u002F3.perimeter-classes",{"title":46,"path":47,"stem":48},"Levels","\u002Fessentials\u002Flevels","2.essentials\u002F4.levels",{"title":50,"path":51,"stem":52},"Boundaries","\u002Fessentials\u002Fboundaries","2.essentials\u002F5.boundaries",{"title":54,"path":55,"stem":56},"Parents","\u002Fessentials\u002Fparents","2.essentials\u002F6.parents",{"title":58,"path":59,"stem":60},"Policies","\u002Fessentials\u002Fpolicies","2.essentials\u002F7.policies",{"title":62,"path":63,"stem":64},"Queries","\u002Fessentials\u002Fqueries","2.essentials\u002F8.queries",{"title":66,"path":67,"stem":68},"Readers","\u002Fessentials\u002Freaders","2.essentials\u002F9.readers",{"title":70,"icon":71,"path":72,"stem":73,"children":74,"page":26},"Search","i-heroicons-magnifying-glass","\u002Fsearch","3.search",[75,79,83,87,91,95,99],{"title":76,"path":77,"stem":78},"Search overview","\u002Fsearch\u002Foverview","3.search\u002F1.overview",{"title":80,"path":81,"stem":82},"Engines","\u002Fsearch\u002Fengines","3.search\u002F2.engines",{"title":84,"path":85,"stem":86},"Keeping the keys fresh","\u002Fsearch\u002Fkeeping-the-keys-fresh","3.search\u002F3.keeping-the-keys-fresh",{"title":88,"path":89,"stem":90},"Exceptions and dates","\u002Fsearch\u002Fexceptions-and-dates","3.search\u002F4.exceptions-and-dates",{"title":92,"path":93,"stem":94},"Searching through a parent","\u002Fsearch\u002Fthrough-a-parent","3.search\u002F5.through-a-parent",{"title":96,"path":97,"stem":98},"Search from the browser","\u002Fsearch\u002Ffrom-the-browser","3.search\u002F6.from-the-browser",{"title":100,"path":101,"stem":102},"Your own search client","\u002Fsearch\u002Fyour-own-client","3.search\u002F7.your-own-client",{"title":104,"icon":105,"path":106,"stem":107,"children":108,"page":26},"Integrations","i-heroicons-puzzle-piece","\u002Fintegrations","4.integrations",[109],{"title":110,"path":111,"stem":112},"laravel-rest-api","\u002Fintegrations\u002Flaravel-rest-api","4.integrations\u002F1.laravel-rest-api",{"title":114,"icon":115,"path":116,"stem":117,"children":118,"page":26},"Testing and Tooling","i-heroicons-wrench-screwdriver","\u002Ftesting-and-tooling","5.testing-and-tooling",[119,123,127,131],{"title":120,"path":121,"stem":122},"Testing","\u002Ftesting-and-tooling\u002Ftesting","5.testing-and-tooling\u002F1.testing",{"title":124,"path":125,"stem":126},"access:check","\u002Ftesting-and-tooling\u002Faccess-check","5.testing-and-tooling\u002F2.access-check",{"title":128,"path":129,"stem":130},"Cache and about","\u002Ftesting-and-tooling\u002Fcache-and-about","5.testing-and-tooling\u002F3.cache-and-about",{"title":132,"path":133,"stem":134},"Generators","\u002Ftesting-and-tooling\u002Fgenerators","5.testing-and-tooling\u002F4.generators",{"title":136,"icon":137,"path":138,"stem":139,"children":140,"page":26},"Digging Deeper","i-heroicons-list-bullet","\u002Fdigging-deeper","6.digging-deeper",[141,145,149,153,157,161,165,169],{"title":142,"path":143,"stem":144},"Abilities","\u002Fdigging-deeper\u002Fabilities","6.digging-deeper\u002F1.abilities",{"title":146,"path":147,"stem":148},"Kept decisions","\u002Fdigging-deeper\u002Fdecisions","6.digging-deeper\u002F2.decisions",{"title":150,"path":151,"stem":152},"Batched decisions","\u002Fdigging-deeper\u002Fbatched-decisions","6.digging-deeper\u002F3.batched-decisions",{"title":154,"path":155,"stem":156},"Row checks","\u002Fdigging-deeper\u002Frow-checks","6.digging-deeper\u002F4.row-checks",{"title":158,"path":159,"stem":160},"Several brands","\u002Fdigging-deeper\u002Fseveral-brands","6.digging-deeper\u002F5.several-brands",{"title":162,"path":163,"stem":164},"Row context","\u002Fdigging-deeper\u002Frow-context","6.digging-deeper\u002F6.row-context",{"title":166,"path":167,"stem":168},"What is public in 1.x","\u002Fdigging-deeper\u002Fpublic-api","6.digging-deeper\u002F7.public-api",{"title":170,"path":171,"stem":172},"Use with AI","\u002Fdigging-deeper\u002Fuse-with-ai","6.digging-deeper\u002F8.use-with-ai",{"id":174,"title":50,"body":175,"description":1162,"extension":1163,"links":1164,"meta":1165,"navigation":239,"path":51,"seo":1166,"sitemap":1167,"stem":52,"updatedAt":1168,"__hash__":1169},"docs\u002F2.essentials\u002F5.boundaries.md",{"type":176,"value":177,"toc":1153},"minimark",[178,183,192,339,347,370,380,386,392,395,427,432,458,547,573,577,580,632,638,642,649,1003,1039,1097,1114,1118,1149],[179,180,182],"h2",{"id":181},"a-condition-on-every-row","A condition on every row",[184,185,186,187,191],"p",{},"A tenant, a workspace or a company is not one more perimeter: it is a condition that every row must meet, whatever the perimeter that grants it. Declare it once in the ",[188,189,190],"code",{},"boundary()"," method of the control:",[193,194,200],"pre",{"className":195,"code":196,"filename":197,"language":198,"meta":199,"style":199},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","use Lomkit\\Access\\Boundaries\\Boundary;\n\nprotected function boundary(): Boundary\n{\n    return Boundary::where('workspace_id', fn (User $user) => $user->current_workspace_id);\n}\n","app\u002FAccess\u002FControls\u002FPostControl.php","php","",[188,201,202,234,241,262,268,333],{"__ignoreMap":199},[203,204,207,211,215,219,222,224,226,228,231],"span",{"class":205,"line":206},"line",1,[203,208,210],{"class":209},"sbssI","use",[203,212,214],{"class":213},"sTEyZ"," Lomkit",[203,216,218],{"class":217},"sMK4o","\\",[203,220,221],{"class":213},"Access",[203,223,218],{"class":217},[203,225,50],{"class":213},[203,227,218],{"class":217},[203,229,230],{"class":213},"Boundary",[203,232,233],{"class":217},";\n",[203,235,237],{"class":205,"line":236},2,[203,238,240],{"emptyLinePlaceholder":239},true,"\n",[203,242,244,248,251,255,258],{"class":205,"line":243},3,[203,245,247],{"class":246},"spNyl","protected",[203,249,250],{"class":246}," function",[203,252,254],{"class":253},"s2Zo4"," boundary",[203,256,257],{"class":217},"():",[203,259,261],{"class":260},"sBMFI"," Boundary\n",[203,263,265],{"class":205,"line":264},4,[203,266,267],{"class":217},"{\n",[203,269,271,275,278,281,284,287,290,294,296,299,302,305,308,311,314,317,320,322,324,327,330],{"class":205,"line":270},5,[203,272,274],{"class":273},"s7zQu","    return",[203,276,277],{"class":260}," Boundary",[203,279,280],{"class":217},"::",[203,282,283],{"class":253},"where",[203,285,286],{"class":217},"(",[203,288,289],{"class":217},"'",[203,291,293],{"class":292},"sfazB","workspace_id",[203,295,289],{"class":217},[203,297,298],{"class":217},",",[203,300,301],{"class":246}," fn",[203,303,304],{"class":217}," (",[203,306,307],{"class":260},"User",[203,309,310],{"class":217}," $",[203,312,313],{"class":213},"user",[203,315,316],{"class":217},")",[203,318,319],{"class":217}," =>",[203,321,310],{"class":217},[203,323,313],{"class":213},[203,325,326],{"class":217},"->",[203,328,329],{"class":213},"current_workspace_id",[203,331,332],{"class":217},");\n",[203,334,336],{"class":205,"line":335},6,[203,337,338],{"class":217},"}\n",[184,340,341,342,346],{},"The boundary applies as an ",[343,344,345],"strong",{},"AND"," around the perimeters:",[348,349,350,354,362],"ul",{},[351,352,353],"li",{},"in the controlled queries and in the policy alike, for every ability;",[351,355,356,357,361],{},"before the ",[358,359,360],"a",{"href":47},"levels",": a user reaches the level of their perimeters, inside their workspace;",[351,363,364,365,369],{},"even for an ",[358,366,368],{"href":367},"\u002Fessentials\u002Fperimeters#unrestricted-perimeters","unrestricted"," perimeter: an administrator who sees every post sees every post of their workspace.",[184,371,372,373,375,376,379],{},"So the perimeters never repeat the condition, and none of them can forget it. Without ",[188,374,190],{},", a control has no boundary, as with ",[188,377,378],{},"Boundary::none()",".",[179,381,383],{"id":382},"boundarywhere",[188,384,385],{},"Boundary::where()",[184,387,388,391],{},[188,389,390],{},"Boundary::where($column, $readerValue)"," keeps the rows whose column equals the value that the closure reads from the reader, an int or a string. The same declaration gives the SQL of the controlled queries and the check of the policy, in memory, without a query.",[184,393,394],{},"The boundary fails closed:",[348,396,397,411,418],{},[351,398,399,400,403,404,407,408,379],{},"A reader value of ",[188,401,402],{},"null",", such as a user without a current workspace, closes the boundary: the user reads no row, and the policy refuses every ability, ",[188,405,406],{},"create"," included. The SQL never compares with ",[188,409,410],{},"IS NULL",[351,412,413,414,417],{},"A reader whose type the closure does not accept, such as an API client for ",[188,415,416],{},"fn (User $user)",", is refused the same way.",[351,419,420,421,423,424,379],{},"Any other value than an int, a string or ",[188,422,402],{}," throws ",[188,425,426],{},"InvalidBoundaryValueException",[428,429,431],"h3",{"id":430},"read-only-rows","Read-only rows",[184,433,434,437,438,440,441,445,446,449,450,453,454,457],{},[188,435,436],{},"Boundary::where(...)->readOnlyWhenNotNull($column)"," keeps a row readable while the column is not null, and refuses it to every other ability. The method exists only on the boundary that ",[188,439,385],{}," returns: for another boundary, write a ",[358,442,444],{"href":443},"#boundary-classes","boundary class"," whose ",[188,447,448],{},"scope()"," and ",[188,451,452],{},"includes()"," refuse the abilities other than ",[188,455,456],{},"view"," on such rows.",[193,459,461],{"className":195,"code":460,"language":198,"meta":199,"style":199},"protected function boundary(): Boundary\n{\n    return Boundary::where('workspace_id', fn (User $user) => $user->current_workspace_id)\n        ->readOnlyWhenNotNull('archived_at');\n}\n",[188,462,463,475,479,524,543],{"__ignoreMap":199},[203,464,465,467,469,471,473],{"class":205,"line":206},[203,466,247],{"class":246},[203,468,250],{"class":246},[203,470,254],{"class":253},[203,472,257],{"class":217},[203,474,261],{"class":260},[203,476,477],{"class":205,"line":236},[203,478,267],{"class":217},[203,480,481,483,485,487,489,491,493,495,497,499,501,503,505,507,509,511,513,515,517,519,521],{"class":205,"line":243},[203,482,274],{"class":273},[203,484,277],{"class":260},[203,486,280],{"class":217},[203,488,283],{"class":253},[203,490,286],{"class":217},[203,492,289],{"class":217},[203,494,293],{"class":292},[203,496,289],{"class":217},[203,498,298],{"class":217},[203,500,301],{"class":246},[203,502,304],{"class":217},[203,504,307],{"class":260},[203,506,310],{"class":217},[203,508,313],{"class":213},[203,510,316],{"class":217},[203,512,319],{"class":217},[203,514,310],{"class":217},[203,516,313],{"class":213},[203,518,326],{"class":217},[203,520,329],{"class":213},[203,522,523],{"class":217},")\n",[203,525,526,529,532,534,536,539,541],{"class":205,"line":264},[203,527,528],{"class":217},"        ->",[203,530,531],{"class":253},"readOnlyWhenNotNull",[203,533,286],{"class":217},[203,535,289],{"class":217},[203,537,538],{"class":292},"archived_at",[203,540,289],{"class":217},[203,542,332],{"class":217},[203,544,545],{"class":205,"line":270},[203,546,338],{"class":217},[184,548,549,550,553,554,556,557,560,561,564,565,568,569,572],{},"An archived post stays in ",[188,551,552],{},"controlled()"," and its ",[188,555,456],{}," is granted, but ",[188,558,559],{},"update",", ",[188,562,563],{},"delete"," and business abilities such as ",[188,566,567],{},"approve"," are refused, and ",[188,570,571],{},"controlled('update')"," leaves it out.",[179,574,576],{"id":575},"refusals","Refusals",[184,578,579],{},"The policy tells two refusals of the boundary apart:",[581,582,583,599],"table",{},[584,585,586],"thead",{},[587,588,589,593,596],"tr",{},[590,591,592],"th",{},"Code",[590,594,595],{},"When",[590,597,598],{},"Status",[600,601,602,616],"tbody",{},[587,603,604,610,613],{},[605,606,607],"td",{},[188,608,609],{},"outside_boundary",[605,611,612],{},"The row is outside the boundary for this ability, but the user may still view it, such as an archived post",[605,614,615],{},"403",[587,617,618,623,629],{},[605,619,620],{},[188,621,622],{},"not_found",[605,624,625,626,628],{},"The boundary also refuses ",[188,627,456],{},", such as a post of another workspace",[605,630,631],{},"404",[184,633,634,635,379],{},"A row of another workspace answers like a row that does not exist, so its existence is never revealed. See ",[358,636,58],{"href":637},"\u002Fessentials\u002Fpolicies#refusals",[179,639,641],{"id":640},"boundary-classes","Boundary classes",[184,643,644,645,648],{},"A condition that one column cannot express is a class that extends ",[188,646,647],{},"Lomkit\\Access\\Boundaries\\Boundary",":",[193,650,653],{"className":195,"code":651,"filename":652,"language":198,"meta":199,"style":199},"namespace App\\Access\\Boundaries;\n\nuse App\\Models\\User;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Lomkit\\Access\\AccessContext;\nuse Lomkit\\Access\\Boundaries\\Boundary;\n\nclass TeamBoundary extends Boundary\n{\n    protected function scope(Builder $query, AccessContext $context): void\n    {\n        $reader = $context->reader();\n\n        $query->whereIn('team_id', $reader instanceof User ? $reader->teams()->select('teams.id') : []);\n\n        if (! $context->ability()->is('view')) {\n            $query->where('locked', false);\n        }\n    }\n}\n","app\u002FAccess\u002FBoundaries\u002FTeamBoundary.php",[188,654,655,673,677,694,718,735,755,760,774,779,815,821,845,850,918,923,960,986,992,998],{"__ignoreMap":199},[203,656,657,660,663,665,667,669,671],{"class":205,"line":206},[203,658,659],{"class":209},"namespace",[203,661,662],{"class":260}," App",[203,664,218],{"class":217},[203,666,221],{"class":260},[203,668,218],{"class":217},[203,670,50],{"class":260},[203,672,233],{"class":217},[203,674,675],{"class":205,"line":236},[203,676,240],{"emptyLinePlaceholder":239},[203,678,679,681,683,685,688,690,692],{"class":205,"line":243},[203,680,210],{"class":209},[203,682,662],{"class":213},[203,684,218],{"class":217},[203,686,687],{"class":213},"Models",[203,689,218],{"class":217},[203,691,307],{"class":213},[203,693,233],{"class":217},[203,695,696,698,701,703,706,708,711,713,716],{"class":205,"line":264},[203,697,210],{"class":209},[203,699,700],{"class":213}," Illuminate",[203,702,218],{"class":217},[203,704,705],{"class":213},"Database",[203,707,218],{"class":217},[203,709,710],{"class":213},"Eloquent",[203,712,218],{"class":217},[203,714,715],{"class":213},"Builder",[203,717,233],{"class":217},[203,719,720,722,724,726,728,730,733],{"class":205,"line":270},[203,721,210],{"class":209},[203,723,214],{"class":213},[203,725,218],{"class":217},[203,727,221],{"class":213},[203,729,218],{"class":217},[203,731,732],{"class":213},"AccessContext",[203,734,233],{"class":217},[203,736,737,739,741,743,745,747,749,751,753],{"class":205,"line":335},[203,738,210],{"class":209},[203,740,214],{"class":213},[203,742,218],{"class":217},[203,744,221],{"class":213},[203,746,218],{"class":217},[203,748,50],{"class":213},[203,750,218],{"class":217},[203,752,230],{"class":213},[203,754,233],{"class":217},[203,756,758],{"class":205,"line":757},7,[203,759,240],{"emptyLinePlaceholder":239},[203,761,763,766,769,772],{"class":205,"line":762},8,[203,764,765],{"class":246},"class",[203,767,768],{"class":260}," TeamBoundary",[203,770,771],{"class":246}," extends",[203,773,261],{"class":260},[203,775,777],{"class":205,"line":776},9,[203,778,267],{"class":217},[203,780,782,785,787,790,792,794,796,799,801,804,806,809,812],{"class":205,"line":781},10,[203,783,784],{"class":246},"    protected",[203,786,250],{"class":246},[203,788,789],{"class":253}," scope",[203,791,286],{"class":217},[203,793,715],{"class":260},[203,795,310],{"class":217},[203,797,798],{"class":213},"query",[203,800,298],{"class":217},[203,802,803],{"class":260}," AccessContext",[203,805,310],{"class":217},[203,807,808],{"class":213},"context",[203,810,811],{"class":217},"):",[203,813,814],{"class":209}," void\n",[203,816,818],{"class":205,"line":817},11,[203,819,820],{"class":217},"    {\n",[203,822,824,827,830,833,835,837,839,842],{"class":205,"line":823},12,[203,825,826],{"class":217},"        $",[203,828,829],{"class":213},"reader ",[203,831,832],{"class":217},"=",[203,834,310],{"class":217},[203,836,808],{"class":213},[203,838,326],{"class":217},[203,840,841],{"class":253},"reader",[203,843,844],{"class":217},"();\n",[203,846,848],{"class":205,"line":847},13,[203,849,240],{"emptyLinePlaceholder":239},[203,851,853,855,857,859,862,864,866,869,871,873,875,877,880,883,886,888,890,892,895,898,901,903,905,908,910,912,915],{"class":205,"line":852},14,[203,854,826],{"class":217},[203,856,798],{"class":213},[203,858,326],{"class":217},[203,860,861],{"class":253},"whereIn",[203,863,286],{"class":217},[203,865,289],{"class":217},[203,867,868],{"class":292},"team_id",[203,870,289],{"class":217},[203,872,298],{"class":217},[203,874,310],{"class":217},[203,876,829],{"class":213},[203,878,879],{"class":217},"instanceof",[203,881,882],{"class":260}," User",[203,884,885],{"class":217}," ?",[203,887,310],{"class":217},[203,889,841],{"class":213},[203,891,326],{"class":217},[203,893,894],{"class":253},"teams",[203,896,897],{"class":217},"()->",[203,899,900],{"class":253},"select",[203,902,286],{"class":217},[203,904,289],{"class":217},[203,906,907],{"class":292},"teams.id",[203,909,289],{"class":217},[203,911,316],{"class":217},[203,913,914],{"class":217}," :",[203,916,917],{"class":217}," []);\n",[203,919,921],{"class":205,"line":920},15,[203,922,240],{"emptyLinePlaceholder":239},[203,924,926,929,932,934,936,938,941,943,946,948,950,952,954,957],{"class":205,"line":925},16,[203,927,928],{"class":273},"        if",[203,930,931],{"class":217}," (!",[203,933,310],{"class":217},[203,935,808],{"class":213},[203,937,326],{"class":217},[203,939,940],{"class":253},"ability",[203,942,897],{"class":217},[203,944,945],{"class":253},"is",[203,947,286],{"class":217},[203,949,289],{"class":217},[203,951,456],{"class":292},[203,953,289],{"class":217},[203,955,956],{"class":217},"))",[203,958,959],{"class":217}," {\n",[203,961,963,966,968,970,972,974,976,979,981,983],{"class":205,"line":962},17,[203,964,965],{"class":217},"            $",[203,967,798],{"class":213},[203,969,326],{"class":217},[203,971,283],{"class":253},[203,973,286],{"class":217},[203,975,289],{"class":217},[203,977,978],{"class":292},"locked",[203,980,289],{"class":217},[203,982,298],{"class":217},[203,984,985],{"class":217}," false);\n",[203,987,989],{"class":205,"line":988},18,[203,990,991],{"class":217},"        }\n",[203,993,995],{"class":205,"line":994},19,[203,996,997],{"class":217},"    }\n",[203,999,1001],{"class":205,"line":1000},20,[203,1002,338],{"class":217},[193,1004,1006],{"className":195,"code":1005,"language":198,"meta":199,"style":199},"protected function boundary(): Boundary\n{\n    return new TeamBoundary;\n}\n",[188,1007,1008,1020,1024,1035],{"__ignoreMap":199},[203,1009,1010,1012,1014,1016,1018],{"class":205,"line":206},[203,1011,247],{"class":246},[203,1013,250],{"class":246},[203,1015,254],{"class":253},[203,1017,257],{"class":217},[203,1019,261],{"class":260},[203,1021,1022],{"class":205,"line":236},[203,1023,267],{"class":217},[203,1025,1026,1028,1031,1033],{"class":205,"line":243},[203,1027,274],{"class":273},[203,1029,1030],{"class":209}," new",[203,1032,768],{"class":260},[203,1034,233],{"class":217},[203,1036,1037],{"class":205,"line":264},[203,1038,338],{"class":217},[348,1040,1041,1061,1075],{},[351,1042,1043,1045,1046,1048,1049,1052,1053,1056,1057,1060],{},[188,1044,448],{}," is required: the condition in SQL, for the controlled queries. It receives the ",[188,1047,732],{},", with the reader and the ability. A join throws ",[188,1050,1051],{},"JoinInPerimeterException",": use ",[188,1054,1055],{},"whereHas()"," or an ",[188,1058,1059],{},"exists"," subquery.",[351,1062,1063,1066,1067,1069,1070,1074],{},[188,1064,1065],{},"includes(Model $row, AccessContext $context): bool",", optional, checks a row in memory. Without it, the policy checks the boundary with one ",[188,1068,1059],{}," query on the row, even for an unrestricted perimeter, and refuses every ",[358,1071,1073],{"href":1072},"\u002Fessentials\u002Fpolicies#drafts","draft",", since a row about to be created is not in the database.",[351,1076,1077,1080,1081,1084,1085,1087,1088,560,1091,449,1094,1096],{},[188,1078,1079],{},"admits(AccessContext $context): bool",", optional, is the boundary without a row. When it returns ",[188,1082,1083],{},"false",", the reader reaches nothing for that ability: ",[188,1086,552],{}," lists no row, and the policy refuses with ",[188,1089,1090],{},"no_perimeter",[188,1092,1093],{},"viewAny",[188,1095,406],{}," included.",[184,1098,1099,1101,1102,1105,1106,449,1108,1110,1111,379],{},[188,1100,190],{}," follows the rule of ",[188,1103,1104],{},"perimeters()",": it is built once per process, so it never reads the user, the request or the tenant while it builds the boundary. Read them in ",[188,1107,448],{},[188,1109,452],{},", from the context. See ",[358,1112,34],{"href":1113},"\u002Fessentials\u002Fcontrols#pure-perimeter-lists",[179,1115,1117],{"id":1116},"good-to-know","Good to know",[348,1119,1120,1133,1144],{},[351,1121,1122,1123,1125,1126,1129,1130,379],{},"A controlled search applies the boundary too: ",[188,1124,385],{}," gives its search keys, and a boundary class declares them in a ",[188,1127,1128],{},"searchKeys()"," method. See ",[358,1131,76],{"href":1132},"\u002Fsearch\u002Foverview#the-boundary",[351,1134,1135,1136,1139,1140,1143],{},"A ",[188,1137,1138],{},"Gate::before()"," callback that returns ",[188,1141,1142],{},"true"," grants before any policy runs, so it bypasses the boundary too, as it bypasses every policy in Laravel.",[351,1145,1146,1147,379],{},"The boundary holds one value per reader. When one list spans several brands or companies, the brand belongs to the perimeters, not to the boundary: see ",[358,1148,158],{"href":159},[1150,1151,1152],"style",{},"html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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);}",{"title":199,"searchDepth":206,"depth":236,"links":1154},[1155,1156,1159,1160,1161],{"id":181,"depth":236,"text":182},{"id":382,"depth":236,"text":385,"children":1157},[1158],{"id":430,"depth":243,"text":431},{"id":575,"depth":236,"text":576},{"id":640,"depth":236,"text":641},{"id":1116,"depth":236,"text":1117},"A boundary is a condition that every row must meet, whatever the perimeter that grants it, such as the tenant or the workspace of the user.","md",null,{},{"title":50,"description":1162},{"loc":51,"lastmod":1168},"2026-11-21T15:24:08+01:00","oSj0iJIsKGxBmAO84mQ8oqHZGG0J3eU7C7zd7CdLbKA",[1171,1173],{"title":46,"path":47,"stem":48,"description":1172,"children":-1},"Levels::of() declares a hierarchy of perimeters, widest first, where only the highest level a user reaches applies. Perimeters outside a group add up.",{"title":54,"path":55,"stem":56,"description":1174,"children":-1},"ThroughParent gives a child row the access of its parent, such as a comment that whoever may view its post may view, through the control of the parent.",1795277180407]