Concepts
Permissions
Restricting access to objects.
The permissions system is split into two parts: The first part deals with who can access entities, which is handled by the access manager. The second part deals with what an actor is allowed to do with an inventory, specifically.
The Access Manager
The GGEntityAccessManager is responsible for granting players access to objects by opening a "context" on behalf of a character.
While it was built specifically with multiplayer in mind, it's also useful for single-player games.
When a context is opened, a context_id is returned.
This is a unique, opaque identifier that grants an actor access to a specific entity.
The context ID is used when the Inventory user interface makes requests to the inventory components.
Game logic can also close contexts, thereby revoking access for a player. Requests fail validation and the user interface automatically closes.
Access Policies
The access manager uses an GGEntityAccessPolicy resource to determine whether the player and character are granted access.
While some generic access policies are included as examples and for fast prototyping, they're intended to be extended for your specific game.
Inventory Access Policies
The GGInventoryAccessPolicy specifies the permissions when a character is interacting
with the inventory.
It can be used to set inventories to read-only, prevent the character from dropping or using specific items and more.