[{"data":1,"prerenderedAt":296},["ShallowReactive",2],{"class-doc-/reference/2.0/gg_permissions/ggentityaccessmanager":3,"navigation":224},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"_id":8,"navigation":6,"addon":5,"version":9,"brief_description":10,"description":11,"tutorials":12,"methods":16,"members":156,"signals":194,"constants":218,"inherits":32,"name":219,"title":219,"_source":220,"_file":221,"_stem":222,"_extension":223},"/reference/2.0/gg_permissions/ggentityaccessmanager","gg_permissions",false,"","content:40.reference:2.0:gg_permissions:GGEntityAccessManager.xml","2.0","Manages player access to an entity by establishing a context.","Players (Clients) that want to interact with a scene make a request to the scene's access manager and specify the entity/actor they will act on behalf of.[br][br]The actor is represented by a [Node], such as the player character. The access manager grants access by returning a context ID (integer). The context ID is then used by the client to perform subsequent actions as that actor.[br][br]The [member access_policy] encapsulates the logic that determines whether access should be granted.[br][br]Use case example: A character/actor requests access to a \"storage box\" entity so the player can interact with the storage box inventory on behalf of the character.",{"link":13},{"#text":14,"@title":15},"https://inventory.gogogodot.io/concepts/permissions#the-access-manager","Conceptual Overview",[17,21,24,35,42,49,53,58,64,69,73,78,82,87,94,100,105,112,118,124,129,133,137,141,146,151],{"description":7,"name":18,"public":6,"returnType":19,"params":20},"_enter_tree","void",[],{"description":7,"name":22,"public":6,"returnType":19,"params":23},"_exit_tree",[],{"description":25,"name":26,"public":27,"returnType":28,"params":29},"Attempts to open a context for an [param actor]. Returns a [code]context_id[/code] or [code]0[/code] indicating no context was opened. Providing a [param nonce] is optional, unless you intend to use [method cancel_context].","open_context",true,"int",[30,33],{"name":31,"type":32},"actor","Node",{"name":34,"type":28},"nonce",{"description":7,"name":36,"public":6,"returnType":28,"params":37},"_sv_open_context",[38,41],{"name":39,"type":40},"actor_path","NodePath",{"name":34,"type":28},{"description":7,"name":43,"public":6,"returnType":19,"params":44},"_cl_open_context",[45,47,48],{"name":46,"type":28},"context_id",{"name":39,"type":40},{"name":34,"type":28},{"description":50,"name":51,"public":27,"returnType":19,"params":52},"If world state changes that might affect open contexts, they must be revalidated, so that invalid contexts will be closed.","revalidate",[],{"description":54,"name":55,"public":27,"returnType":19,"params":56},"Removes all contexts for a specific [param actor]. Can only be called on the server.","close_all_contexts",[57],{"name":31,"type":32},{"description":7,"name":59,"public":6,"returnType":19,"params":60},"_remove_contexts",[61],{"name":62,"type":63},"contexts","GGEntityAccessManager.Context[]",{"description":65,"name":66,"public":27,"returnType":19,"params":67},"Used by clients to cancel a pending context. Will also close a context if it was already opened. In order for cancellation to work properly, the caller must have provided a [param nonce] to [method open_context].[br]","cancel_context",[68],{"name":34,"type":28},{"description":7,"name":70,"public":6,"returnType":19,"params":71},"_sv_cancel_context",[72],{"name":34,"type":28},{"description":74,"name":75,"public":27,"returnType":19,"params":76},"When invoked, will revoke access to the inventory for the [param actor]. If [param context_id] is not provided, it will removed all contexts for the client.","close_context",[77],{"name":46,"type":28},{"description":7,"name":79,"public":6,"returnType":19,"params":80},"_sv_close_context",[81],{"name":46,"type":28},{"description":7,"name":83,"public":6,"returnType":19,"params":84},"_cl_close_context",[85,86],{"name":46,"type":28},{"name":34,"type":28},{"description":7,"name":88,"public":6,"returnType":19,"params":89},"_set_pending_request",[90,92,93],{"name":91,"type":28},"remote_sender_id",{"name":34,"type":28},{"name":31,"type":32},{"description":7,"name":95,"public":6,"returnType":96,"params":97},"_is_pending_request","bool",[98,99],{"name":91,"type":28},{"name":34,"type":28},{"description":7,"name":101,"public":6,"returnType":19,"params":102},"_remove_pending_request",[103,104],{"name":91,"type":28},{"name":34,"type":28},{"description":7,"name":106,"public":6,"returnType":28,"params":107},"_add_context_for_actor",[108,109,110,111],{"name":31,"type":32},{"name":34,"type":28},{"name":91,"type":28},{"name":46,"type":28},{"description":113,"name":114,"public":27,"returnType":96,"params":115},"Returns true if a context for the [param actor] owned by the [param remote_sender_id] exists.","has_context",[116,117],{"name":31,"type":32},{"name":91,"type":28},{"description":119,"name":120,"public":27,"returnType":32,"params":121},"Used by other components to determine the actor based on the [param context_id] and [param remote_sender_id].","find_actor_for_context",[122,123],{"name":46,"type":28},{"name":91,"type":28},{"description":7,"name":125,"public":6,"returnType":63,"params":126},"_remove_context",[127,128],{"name":91,"type":28},{"name":46,"type":28},{"description":130,"name":131,"public":27,"returnType":28,"params":132},"The number of contexts this access manager has. Clients are only aware of their own contexts.","context_count",[],{"description":7,"name":134,"public":6,"returnType":19,"params":135},"_add_subscriber",[136],{"name":91,"type":28},{"description":7,"name":138,"public":6,"returnType":19,"params":139},"_remove_subscriber",[140],{"name":91,"type":28},{"description":142,"name":143,"public":27,"returnType":144,"params":145},"Returns an array of [code]peer_id[/code]s that have at least one open context with this access manager.","get_subscribers","int[]",[],{"description":7,"name":147,"public":6,"returnType":148,"params":149},"_make_await_handler","GGEntityAccessManager.AwaitHandler",[150],{"name":34,"type":28},{"description":7,"name":152,"public":6,"returnType":19,"params":153},"_resolve_await_handler",[154,155],{"name":34,"type":28},{"name":46,"type":28},[157,162,166,170,175,178,181,185,188,190,192],{"name":158,"description":159,"type":160,"setter":7,"getter":7,"default":161,"public":27},"access_policy","The access policy determines whether opening a context succeeds","GGEntityAccessPolicy","new()",{"name":163,"description":164,"type":28,"setter":7,"getter":7,"default":165,"public":27},"max_contexts_per_client","Limits the number of concurrent contexts a single client (i.e. [code]remote_sender_id[/code]) can have open.","5",{"name":167,"description":168,"type":96,"setter":7,"getter":7,"default":169,"public":27},"sync_with_all_clients","When enabled, [method get_subscribers] returns [code]0[/code] to broadcast an RPC to all clients. This bypasses the need for [method open_context], if the [member access_policy] supports it.","false",{"name":171,"description":172,"type":173,"setter":7,"getter":7,"default":174,"public":27},"await_rpc_timeout","How long the client should wait on the server for a reply when opening a context before considering it a failure. Only used client-side.","float","5.0",{"name":176,"type":144,"setter":7,"getter":7,"default":177,"public":6},"_subscribers","[]",{"name":179,"type":28,"setter":7,"getter":7,"default":180,"public":6},"_next_await_request_id","1",{"name":182,"type":183,"setter":7,"getter":7,"default":184,"public":6},"_await_handlers","Dictionary[int, GGEntityAccessManager.AwaitHandler]","{}",{"name":186,"type":187,"setter":7,"getter":7,"default":184,"public":6},"_pending_requests","Dictionary[int, Dictionary]",{"name":189,"type":187,"setter":7,"getter":7,"default":184,"public":6},"_contexts",{"name":191,"type":28,"setter":7,"getter":7,"default":180,"public":6},"_next_context_id",{"name":193,"type":96,"setter":7,"getter":7,"default":169,"public":6},"_leaving_tree",[195,203,210],{"description":196,"name":197,"params":198},"Emitted when a context was opened. The signal will be emitted on both the server and the client that made the [method open_context] request.","context_opened",[199,200,201,202],{"name":46,"type":28},{"name":31,"type":32},{"name":34,"type":28},{"name":91,"type":28},{"description":204,"name":205,"params":206},"Emitted when opening a context was denied. The signal will be emitted on both the server and the client that made the [method open_context] request.","context_denied",[207,208,209],{"name":31,"type":32},{"name":34,"type":28},{"name":91,"type":28},{"description":211,"name":212,"params":213},"Emitted when a context was closed. The signal will be emitted on both the server and the client that made the [method close_context] request. The signal may also be emitted when the server decides to close a context for any other reason, such as when [method close_all_contexts] is used.","context_closed",[214,215,216,217],{"name":46,"type":28},{"name":31,"type":32},{"name":34,"type":28},{"name":91,"type":28},[],"GGEntityAccessManager","content","40.reference/2.0/gg_permissions/GGEntityAccessManager.xml","40.reference/2.0/gg_permissions/GGEntityAccessManager","xml",[225,234,261,281],{"title":226,"_path":227,"children":228},"Getting Started","/getting-started",[229,231],{"title":230,"_path":227},"Introduction",{"title":232,"_path":233},"Installation","/getting-started/installation",{"title":235,"_path":236,"children":237},"Concepts","/concepts",[238,240,243,246,249,252,255,258],{"title":239,"_path":236},"Overview",{"title":241,"_path":242},"Inventory","/concepts/inventory",{"title":244,"_path":245},"Interactions","/concepts/interaction",{"title":247,"_path":248},"Permissions","/concepts/permissions",{"title":250,"_path":251},"Multiplayer","/concepts/multiplayer",{"title":253,"_path":254},"User Interface","/concepts/user-interface",{"title":256,"_path":257},"Game Integration","/concepts/game-integration",{"title":259,"_path":260},"Crafting","/concepts/crafting",{"title":262,"_path":263,"children":264},"Demos","/demos",[265,267,270,273,275,278],{"title":266,"_path":263},"Inventory Tour",{"title":268,"_path":269},"Inventory UI Playground","/demos/inventory_ui",{"title":271,"_path":272},"Inventory Game UI","/demos/inventory_game_ui",{"title":259,"_path":274},"/demos/crafting",{"title":276,"_path":277},"Multiplayer Lobby","/demos/mp_lobby",{"title":279,"_path":280},"Sequencer (prototype)","/demos/sequencer",{"title":282,"_path":283,"children":284},"Guide","/guide",[285,287,290,293],{"title":286,"_path":283},"Architecture Deep Dive",{"title":288,"_path":289},"Design Principles","/guide/design-principles",{"title":291,"_path":292},"Changelog v2.x","/guide/changelog-v2",{"title":294,"_path":295},"Changelog v1.x","/guide/changelog",1743268971425]