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
FNameassigned to theUMP_InventoryComponent. This ID is used by theUMP_ItemRegistryfor global lookups. - OwnerID: An
FNamethat 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_InventoryManagercan interact with this component. Suitable for public containers, dropped loot, or world items.
2. Player Ownership
- OwnerID: Matches the
ManagerIDof a specificUMP_InventoryManager(e.g.,Player_0). - Behavior: Only the specific Player Controller with the matching
ManagerIDcan 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
AccessListarray ofFNames. AUMP_InventoryManagercan only interact with this component if itsManagerIDis present in theAccessList. 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.