Access Control & Ownership

Validating inventory permissions

The plugin uses a permission system to control which players can modify specific inventories. Access is determined by the OwnerID and AccessList properties of the UMP_InventoryComponent.

Identification Properties

  • InventoryID: A unique FName assigned to the UMP_InventoryComponent. This ID is used by the UMP_ItemRegistry for global lookups.
  • OwnerID: An FName that determines the primary permission level of the inventory.

Access Levels

The system supports three primary access configurations based on the OwnerID.

1. Global Access

  • OwnerID: Set to GLOBAL.
  • Behavior: Any UMP_InventoryManager can interact with this component. Suitable for public containers, dropped loot, or world items.

2. Player Ownership

  • OwnerID: Matches the ManagerID of a specific UMP_InventoryManager (e.g., Player_0).
  • Behavior: Only the specific Player Controller with the matching ManagerID can modify this component. Suitable for personal player backpacks or equipped items.

3. Private Access with Whitelist

  • OwnerID: Set to PRIVATE.
  • Behavior: Access is restricted to explicitly allowed players.
  • Configuration: The component maintains an AccessList array of FNames. A UMP_InventoryManager can only interact with this component if its ManagerID is present in the AccessList. Suitable for faction storage or party stashes.

Authorization Flow

When an operation is requested through the UMP_InventoryManager, it calls GetAndValideInventory(TargetInventoryID). This function checks the OwnerID against the requesting client's ManagerID. If the client lacks permission, the operation is blocked, and an Access Denied notification is dispatched to the client.