RevokeHousingKey
exports['kartik-properties']:RevokeHousingKey(propertyId, targetCid, revokedByCid)🔹 Description
Revokes access for a citizen holding a key to a specific property. Cleans up property keys, resets rent split records, and logs an audit entry.
🔧 Parameters
| Name | Type | Required | Description |
|---|---|---|---|
propertyId | number | string | ✅ | Property ID from which access is being removed. |
targetCid | string | ✅ | Citizen ID whose key is being revoked. |
revokedByCid | string | ❌ | Citizen ID performing the revocation (defaults to 'phone'). |
📤 Returns
| Type | Description |
|---|---|
table | Result table { success = true/false }. |
🧠 Example Usage
local result = exports['kartik-properties']:RevokeHousingKey(12, 'XYZ98765', 'ABC12345')
if result.success then
print('Key successfully revoked!')
end